/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFramePTZControl.java
 *
 * Created on 2009-11-2, 9:08:17
 */
/**
 * @author Administrator
 */

package ClientDemo;

import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.IntByReference;
import ocr.AccurateBasic;
import ocr.PictureScale;
import ocr.Sample;
import org.json.JSONObject;

import javax.swing.JOptionPane;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.text.SimpleDateFormat;
import java.util.*;

/*****************************************************************************
 *类 ：   JFramePTZControl
 *类描述 ：云台控制
 ****************************************************************************/
public class JFramePTZControl extends javax.swing.JFrame {

    /************成员变量*****************/
    static HCNetSDK hCNetSDK = HCNetSDK.INSTANCE;
    private NativeLong m_lRealHandle;//预览句柄
    private boolean m_bAutoOn;//自动左右云台
    private boolean m_bLightOn;//开启灯光
    private boolean m_bWiperOn;//开启雨刷
    private boolean m_bFanOn;//开启风扇
    private boolean m_bHeaterOn;//开启加热
    private boolean m_bAuxOn1;//开启辅助1
    private boolean m_bAuxOn2;//开启辅助2
    private boolean m_bIsOnCruise;//是否在巡航

    private int m_iBrightness;//亮度
    private int m_iContrast;//对比度
    private int m_iSaturation;//饱和度
    private int m_iHue;//色度
    private int m_iVolume;//音量

    //自己写的代码在这
    //下面三行代码与控制Z相关
    HCNetSDK.NET_DVR_PTZPOS m_ptzPosCurrent = new HCNetSDK.NET_DVR_PTZPOS();
    IntByReference ibrBytesReturned = new IntByReference(0);
    Pointer pioint = m_ptzPosCurrent.getPointer();
    int x1;     //目标左上点x坐标
    int y1;     //目标左上点y坐标
    int x2;     //目标右下点x坐标
    int y2;     //目标右下点y坐标
    int leftUpLine = 185;   //放大区域的左边界线
    int rightUpLine = 220;  //放大区域的额右边界线
    int lScreenshot = 190;  //截图区域左界线
    int rScreenshot = 208;  //截图区域右界线
    String direction = new String();        //记录船过来的方向
    private boolean captureFlag = true;    //避免重复截图
    SimpleDateFormat tf = new SimpleDateFormat("HHmmss");//设置时间格式
    String lastControl = new String();  //记录上一次的控制指令
    int lastSpeed ;
    Map<String, Integer> map = new HashMap<>();    //存坐标
    public boolean setZflag = true;
    public int midZ = 4;    //截图时放大的倍数
    int midCaptureNum = 2;
    int rightCaptureNum = 2;
    int screenMidx = 640 / 2;
    int screenMidy = 480 / 2;
    Socket accept = null;
    int minNum = 2; //微调次数
    Map<String,Integer> pointsMap = new HashMap<>();

    public static boolean showJframFlag = true;
    private boolean darkeCapture = true;


    /*************************************************
     函数:      JFramePTZControl
     函数描述:	构造函数   Creates new form JFramePTZControl
     *************************************************/
    public JFramePTZControl(NativeLong lRealHandle) {
        m_lRealHandle = lRealHandle;
        m_bAutoOn = false;
        m_bLightOn = false;
        m_bWiperOn = false;
        m_bFanOn = false;
        m_bHeaterOn = false;
        m_bAuxOn1 = false;
        m_bAuxOn2 = false;
        m_bIsOnCruise = false;

        m_iBrightness = 6;
        m_iContrast = 6;
        m_iSaturation = 6;
        m_iHue = 6;
        m_iVolume = 50;

        initComponents();
        int i;
        for (i = 0; i < HCNetSDK.MAX_PRESET_V30; i++) {
            jComboBoxPreset.addItem(i + 1);
        }
        jComboBoxPreset.setSelectedIndex(0);

        //巡航轨迹
        for (i = 0; i < HCNetSDK.MAX_CRUISE_V30; i++) {
            jComboBoxSeq.addItem(i + 1);
        }
        jComboBoxSeq.setSelectedIndex(0);

        jComboBoxSpeed.setSelectedIndex(4); //初始化速度
        jComboBoxValue.setSelectedIndex(4); //初始化阈值
    }

    public void mapping(JSONObject json) {

        int autoControlSelectIndex = jComboBoxAutoControl.getSelectedIndex();   //下标0开，1关
        if (autoControlSelectIndex == 0) {
            //           System.out.println("客户端发送：" + s);  // 数据格式 s = person 0.43_110,80_565,479
            Set<String> jsonKeySet = json.keySet();
            String s = null;
            //目标中心点已经移动到镜头的中间，开始调焦
            HashMap<Integer, Integer> ptZosd = getPTZ();
            int P = ptZosd.get(1);  //获取P的值
            if (P < leftUpLine || (P > rightUpLine)){
                System.out.println("mapp1");
                s = json.get("boat").toString();
//                testControl(s,P);
                boatControl(s);
            } else if (jsonKeySet.contains("card")) {
                System.out.println("mapp2");
                s = json.get("card").toString();
//                cardControl(s,P);
            }else if (jsonKeySet.contains("boat")) {
                System.out.println("mapp3");
                s = json.get("boat").toString();
//                testControl(s, P);
                boatControl(s);
            }
//        for (int i = 0; i < message.length; i++) {
//            System.out.println(message[i]);
//        }
//        for (int i = 0; i < object.length; i++) {
//            System.out.println(object[i]);
//        }
//        System.out.println();

        }
//                                System.out.println(object[0]);

    }



    public void boatControl(String s) {
//           System.out.println("客户端发送：" + s);  // 数据格式 s = person 0.43_110,80_565,479
        String[] message = s.split("_");  // 分割
        String[] object = message[0].split(" ");  //object为目标的名称和概率
        int autoControlSelectIndex = jComboBoxAutoControl.getSelectedIndex();   //下标0开，1关
        int selectedFlagIndex = jComboBoxValue.getSelectedIndex();  //阀值
        if (autoControlSelectIndex == 0) {
            try {
                if ("boat".equals(object[0]) && Float.parseFloat(object[1]) * 10 >= selectedFlagIndex + 1) {
                    int speed = 3;
                    int area = 0;
                    try {
                        String[] left = message[1].split(",");
                        x1 = Integer.parseInt(left[0]);
                        y1 = Integer.parseInt(left[1]);
                        String[] right = message[2].split(",");
                        x2 = Integer.parseInt(right[0]);
                        y2 = Integer.parseInt(right[1]);
                        area = Math.abs((x2 - x1) * (y1 - y2));
                    } catch (NumberFormatException e) {
//                                                e.printStackTrace();
                        return;
                    }
//                                            System.out.println("面积：" + area);
                    String cmd = "";
                    int objectMidx = (x1 + x2) / 2;
                    int objectMidy = (y1 + y2) / 2;
                    //目标中心点已经移动到镜头的中间，开始调焦
                    HashMap<Integer, Integer> ptZosd = getPTZ();
                    int P = ptZosd.get(1);  //获取P的值
                    if (P < leftUpLine || (P > rightUpLine && (P < 270 || P > 275))) {    //放大区域外的控制代码
                        if (P < 150) {  //记录船来方向
                            direction = "left";
                        } else if (P > 230) {
                            direction = "right";
                        }

                        //左边的船太快,把中心点左移一点
                        if ("left".equals(direction)) {
                            screenMidx = 640 / 2 - 30;
                            screenMidy = 480 / 2;
                        }
                        minNum = 4;    //设置微调的次数为4
                        midCaptureNum = 2;  //中间点截图数为2
                        rightCaptureNum = 2;    //右边截图数为2
                        //移动到右边
                        if ("right".equals(direction) && P < 185) {
                            jComboBoxAutoControl.setSelectedIndex(1);   //关闭yolov5联动
                            moveControl(250, 7, 1);
                            try {
                                Thread.sleep(1500);
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                            jComboBoxAutoControl.setSelectedIndex(0);   //开启yolov5联动
                            return;
                        }

                        //移动到左边
                        if ("left".equals(direction) && P > 220) {
                            jComboBoxAutoControl.setSelectedIndex(1);   //关闭yolov5联动
                            moveControl(150, 16, 1);
                            try {
                                Thread.sleep(1500);
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                            jComboBoxAutoControl.setSelectedIndex(0);   //开启yolov5联动
                            return;
                        }

                        //设置区域边界线
                        if ("right".equals(direction)) {
                            leftUpLine = 185;   //放大区域的左边界线
                            rightUpLine = 220;  //放大区域的额右边界线
                            lScreenshot = 190;  //截图区域左界线
                            rScreenshot = 208;  //截图区域右界线
                        } else {
                            leftUpLine = 160;   //放大区域的左边界线
                            rightUpLine = 210;  //放大区域的右边界线
                            lScreenshot = 185;  //截图区域左界线
                            rScreenshot = 210;  //截图区域右界线
                        }

                        //根据目标坐标确定摄像头移动方
                        if (objectMidx < screenMidx - 50 && objectMidy < screenMidy - 50) {
                            if (objectMidx < screenMidx - 100 && objectMidy < screenMidy - 100) {
                                speed = 4;
                            } else {
                                speed = 3;
                            }
                            cmd = "lu";

                        } else if (objectMidx < screenMidx - 50 && objectMidy > screenMidy + 50) {
                            if (objectMidx < screenMidx - 100 && objectMidy > screenMidy + 100) {
                                speed = 4;
                            } else {
                                speed = 3;
                            }
                            cmd = "ld";

                        } else if (objectMidx > screenMidx + 50 && objectMidy < screenMidy - 50) {
                            if (objectMidx > screenMidx + 100 && objectMidy < screenMidy - 100) {
                                speed = 4;
                            } else {
                                speed = 3;
                            }
                            cmd = "ru";

                        } else if (objectMidx > screenMidx + 50 && objectMidy > screenMidy + 50) {
                            if (objectMidx > screenMidx + 100 && objectMidy > screenMidy + 100) {
                                speed = 4;
                            } else {
                                speed = 3;
                            }
                            cmd = "rd";

                        } else if (objectMidx < screenMidx - 50) {
                            if (objectMidx < screenMidx - 100) {
                                speed = 4;
                            } else {
                                speed = 3;
                            }
                            cmd = "l";
                        } else if (objectMidx > screenMidx + 50) {
                            if (objectMidx > screenMidx + 100) {
                                speed = 4;
                            } else {
                                speed = 3;
                            }
                            cmd = "r";
                        } else if (objectMidy < screenMidy - 50) {
                            if (objectMidy < screenMidy - 100) {
                                speed = 4;
                            } else {
                                speed = 3;
                            }
                            cmd = "u";
                        } else if (objectMidy > screenMidy + 50) {
                            if (objectMidy > screenMidy + 100) {
                                speed = 4;
                            } else {
                                speed = 3;
                            }
                            cmd = "d";
                        }
//                        //目标面积小，移动速度直接慢点
                        if (area < 100 * 100) {
                            if (Math.abs(objectMidx - screenMidx) > 100 || Math.abs(objectMidy - screenMidy) > 100) {
                                speed = 3;
                            } else {
                                speed = 2;
                            }
                        }
                        jComboBoxSpeed.setSelectedIndex(speed);
                        if (!setContral(cmd)) {     //返回false代表目标以及在屏幕中间
                            if (area > 280 * 200) {
                                setZ("down", 1);     //伸(缩小)
                            } else if (area < 70 * 100) {
                                setZ("up", 1);    //缩(放大)
                            }
                        } else {
                            lastSpeed = speed;
                            if (area > 280 * 200) {     //目标太大，即使不在屏幕中间，也可以缩小
                                setZ("down", 1);     //伸(缩小)
                            }
                        }
                    } else {
                        //以下为截图与放大区域的操作

                        if (objectMidx < screenMidx - 100 && objectMidy < screenMidy - 70) {
                            if (objectMidx < screenMidx - 150 && objectMidy < screenMidy - 150)
                                speed = 5;
                            else
                                speed = 4;
                            cmd = "lu";

                        } else if (objectMidx < screenMidx - 100 && objectMidy > screenMidy + 70) {
                            if (objectMidx < screenMidx - 150 && objectMidy > screenMidy + 150)
                                speed = 5;
                            else
                                speed = 4;
                            cmd = "ld";

                        } else if (objectMidx > screenMidx + 100 && objectMidy < screenMidy - 70) {
                            if (objectMidx > screenMidx + 150 && objectMidy < screenMidy - 150)
                                speed = 5;
                            else
                                speed = 4;
                            cmd = "ru";

                        } else if (objectMidx > screenMidx + 100 && objectMidy > screenMidy + 70) {
                            if (objectMidx > screenMidx + 150 && objectMidy > screenMidy + 150)
                                speed = 5;
                            else
                                speed = 4;
                            cmd = "rd";

                        } else if (objectMidx < screenMidx - 70) {
                            if (objectMidx < screenMidx - 200) {
                                speed = 6;
                            } else if (objectMidx < screenMidx - 100) {
                                speed = 5;
                            } else {
                                speed = 4;
                            }
                            cmd = "l";
                        } else if (objectMidx > screenMidx + 70) {
                            if (objectMidx > screenMidx + 200) {
                                speed = 6;
                            } else if (objectMidx > screenMidx + 100) {
                                speed = 5;
                            } else {
                                speed = 4;
                            }
                            cmd = "r";
                        } else if (objectMidy < screenMidy - 50) {
//                            if (objectMidy < screenMidy - 150) {
//                                speed = 6;
//                            } else
                            if (objectMidy < screenMidy - 150) {
                                speed = 5;
                            } else {
                                speed = 4;
                            }
                            cmd = "u";
                        } else if (objectMidy > screenMidy + 50) {
//                            if (objectMidy > screenMidy + 150) {
//                                speed = 6;
//                            } else
                            if (objectMidy > screenMidy + 150) {
                                speed = 5;
                            } else {
                                speed = 4;
                            }
                            cmd = "d";
                        }
//                        if (area < 200 * 200) {
//                            if (Math.abs(objectMidx - screenMidx) > 150 || Math.abs(objectMidy - screenMidy) > 150) {
//                                speed = 4;
//                            } else {
//                                speed = 3;   //目标面积小，移动速度直接慢点
//                            }
//                        }

                        if (P > 270 && P < 275) {
                            speed = speed--;    //远处目标放大后移动慢，镜头速度可以慢点
                        }
                        jComboBoxSpeed.setSelectedIndex(speed);

                        if ((P >= lScreenshot && P <= rScreenshot) || (P >= 270 && P <= 273)) {
                            System.out.println("进入截图区域；；；；p =" + P);
                            if (!setContral(cmd)) {     //返回false 证明此时目标中心点不在屏幕中心区域
                                if (area < 450 * 300 && area > 350 * 200) {       //适合截图的面积
                                    System.out.println("开始中心点捉图！！！");
                                    setFlag(P);
                                } else {
                                    if (area > 450 * 300) {
                                        setZ("down", 1);     //伸(缩小)
                                    } else if (area < 350 * 200) {
                                        setZ("up", 1);    //缩(放大)
                                    } else if (area < 350 * 300 && minNum > 0) {  //进行微调，缩（放大）
                                        System.out.println("Z值开始微调放大");
                                        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 0);
                                        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 1);
                                    }
//                                    else if (area > 350 * 300 && minNum > 0) {
//                                        System.out.println("Z值开始微调缩小");
//                                        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 0);
//                                        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 1);
//                                    }
                                }
                            } else {
                                lastSpeed = speed;
                                // 移动屏幕的过程中发现目标面积太大，可以直接缩小倍数
                                if (area > 450 * 300) {
                                    setZ("down", 1);
                                } else if (area < 450 * 300 && area > 350 * 200 && x1 > 50 && x2 < 590 && y1 > 50 && y2 < 430) {       //适合截图的面积
                                    System.out.println("=====非中心点捉图====");
                                    setFlag(P);
                                }

                            }
                        } else {    //在这方位内先提前调好焦距
                            System.out.println("进入放大范围-----p = " + P);
                            if (!setContral(cmd)) {
                                if (area > 450 * 300) {
                                    setZ("down", 1);     //伸(缩小)
                                } else if (area < 350 * 200) {
                                    setZ("up", 1);    //缩(放大)
                                } else if (area < 350 * 300 && minNum > 0) {  //进行微调，缩（放大）
                                    System.out.println("Z值开始微调放大");
                                    PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 0);
                                    PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 1);
                                    minNum--;
                                }
//                                else if (area > 350 * 300 && minNum > 0) {
//                                    System.out.println("Z值开始微调缩小");
//                                    PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 0);
//                                    PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 1);
//                                    minNum--;
//                                }
                            }else {
                                lastSpeed = speed;
                            }

                        }

                    }

                }
            } catch (NumberFormatException e) {
                e.printStackTrace();
            }
        }
//                                System.out.println(object[0]);
    }

    //晚上控制代码
    public void doDarkConrol(String s) {
//           System.out.println("客户端发送：" + s);  // 数据格式 s = person 0.43_110,80_565,479
        String[] message = s.split("_");  // 分割
        String[] object = message[0].split(" ");  //object为目标的名称和概率
        int autoControlSelectIndex = jComboBoxAutoControl.getSelectedIndex();   //下标0开，1关
        int selectedFlagIndex = jComboBoxValue.getSelectedIndex();  //阀值
        if (autoControlSelectIndex == 0) {
            try {
                if ("boat".equals(object[0]) && Float.parseFloat(object[1]) * 10 >= selectedFlagIndex + 1) {
                    int speed = 3;
                    int area = 0;
                    try {
                        String[] left = message[1].split(",");
                        x1 = Integer.parseInt(left[0]);
                        y1 = Integer.parseInt(left[1]);
                        String[] right = message[2].split(",");
                        x2 = Integer.parseInt(right[0]);
                        y2 = Integer.parseInt(right[1]);
                        area = Math.abs((x2 - x1) * (y1 - y2));
                    } catch (NumberFormatException e) {
//                                                e.printStackTrace();
                        return;
                    }
//                                            System.out.println("面积：" + area);
                    String cmd = "";
                    int objectMidx = (x1 + x2) / 2;
                    int objectMidy = (y1 + y2) / 2;
                    //目标中心点已经移动到镜头的中间，开始调焦
                    HashMap<Integer, Integer> ptZosd = getPTZ();
                    int P = ptZosd.get(1);  //获取P的值
                    if (P < leftUpLine || (P > rightUpLine && (P < 270 || P > 275))) {    //放大区域外的控制代码
                        if (P < 150) {  //记录船来方向
                            direction = "left";
                        } else if (P > 230) {
                            direction = "right";
                        }

                        //左边的船太快,把中心点左移一点
                        if ("left".equals(direction)) {
                            screenMidx = 640 / 2 - 30;
                            screenMidy = 480 / 2;
                        }
                        minNum = 4;    //设置微调的次数为4
                        midCaptureNum = 2;  //中间点截图数为2
                        rightCaptureNum = 2;    //右边截图数为2
                        //移动到右边
                        if ("right".equals(direction) && P < 185) {
                            jComboBoxAutoControl.setSelectedIndex(1);   //关闭yolov5联动
                            moveControl(250, 7, 1);
                            try {
                                Thread.sleep(1500);
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                            jComboBoxAutoControl.setSelectedIndex(0);   //开启yolov5联动
                            return;
                        }

                        //移动到左边
                        if ("left".equals(direction) && P > 220) {
                            jComboBoxAutoControl.setSelectedIndex(1);   //关闭yolov5联动
                            moveControl(150, 16, 1);
                            try {
                                Thread.sleep(1500);
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                            jComboBoxAutoControl.setSelectedIndex(0);   //开启yolov5联动
                            return;
                        }

                        //设置区域边界线
                        if ("right".equals(direction)) {
                            leftUpLine = 185;   //放大区域的左边界线
                            rightUpLine = 220;  //放大区域的额右边界线
                            lScreenshot = 190;  //截图区域左界线
                            rScreenshot = 208;  //截图区域右界线
                        } else {
                            leftUpLine = 160;   //放大区域的左边界线
                            rightUpLine = 210;  //放大区域的右边界线
                            lScreenshot = 185;  //截图区域左界线
                            rScreenshot = 210;  //截图区域右界线
                        }

                        //根据目标坐标确定摄像头移动方
                        if (objectMidx < screenMidx - 100 && objectMidy < screenMidy - 100) {

                            cmd = "lu";

                        } else if (objectMidx < screenMidx - 100 && objectMidy > screenMidy + 100) {

                            cmd = "ld";

                        } else if (objectMidx > screenMidx + 100 && objectMidy < screenMidy - 100) {

                            cmd = "ru";

                        } else if (objectMidx > screenMidx + 100 && objectMidy > screenMidy + 100) {

                            cmd = "rd";

                        } else if (objectMidx < screenMidx - 100) {

                            cmd = "l";
                        } else if (objectMidx > screenMidx + 100) {

                            cmd = "r";
                        } else if (objectMidy < screenMidy - 100) {

                            cmd = "u";
                        } else if (objectMidy > screenMidy + 100) {

                            cmd = "d";
                        }
                        speed = 2;
//                        //目标面积小，移动速度直接慢点
//                        if (area < 100 * 100) {
//                            if (Math.abs(objectMidx - screenMidx) > 100 || Math.abs(objectMidy - screenMidy) > 100) {
//                                speed = 3;
//                            } else {
//                                speed = 2;
//                            }
//                        }
                        jComboBoxSpeed.setSelectedIndex(speed);
                        if (!setContral2(cmd)) {     //返回false代表目标以及在屏幕中间
                            stopContral2(lastControl);  //目标在船中间，停止移动
                            if (area > 280 * 200) {
                                setZ("down", 1);     //伸(缩小)
                            } else if (area < 70 * 100) {
                                setZ("up", 1);    //缩(放大)
                            }
                        } else {
                            if (area > 280 * 200) {     //目标太大，即使不在屏幕中间，也可以缩小
                                setZ("down", 1);     //伸(缩小)
                            }
                        }
                    } else {
                        //以下为截图与放大区域的操作
                        speed =3;
                        if (P > 270 && P < 275) {
                            speed = speed--;    //远处目标放大后移动慢，镜头速度可以慢点
                        }
                        jComboBoxSpeed.setSelectedIndex(speed);
                        if ((P >= lScreenshot && P <= rScreenshot) || (P >= 270 && P <= 273)) {
                            System.out.println("进入截图区域；；；；p =" + P);
                            if (!setContral2(cmd)) {     //返回false 证明此时目标中心点在屏幕中心区域
                                stopContral2(lastControl);
                                if (area < 450 * 300 && area > 350 * 200) {       //适合截图的面积
                                    System.out.println("开始中心点捉图！！！");
                                    setFlag(P);
                                } else {
                                    if (area > 450 * 300) {
                                        setZ("down", 1);     //伸(缩小)
                                    } else if (area < 350 * 200) {
                                        setZ("up", 1);    //缩(放大)
                                    } else if (area < 350 * 300 && minNum > 0) {  //进行微调，缩（放大）
                                        System.out.println("Z值开始微调放大");
                                        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 0);
                                        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 1);
                                    }
//                                    else if (area > 350 * 300 && minNum > 0) {
//                                        System.out.println("Z值开始微调缩小");
//                                        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 0);
//                                        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 1);
//                                    }
                                }
                            } else {
                                lastSpeed = speed;
                                // 移动屏幕的过程中发现目标面积太大，可以直接缩小倍数
                                if (area > 450 * 300) {
                                    setZ("down", 1);
                                } else if (area < 450 * 300 && area > 350 * 200 && x1 > 50 && x2 < 590 && y1 > 50 && y2 < 430) {       //适合截图的面积
                                    System.out.println("=====非中心点捉图====");
                                    setFlag(P);
                                }

                            }
                        } else {    //在这方位内先提前调好焦距
                            System.out.println("进入放大范围-----p = " + P);
                            if (!setContral(cmd)) {
                                stopContral2(cmd);
                                if (area > 450 * 300) {
                                    setZ("down", 1);     //伸(缩小)
                                } else if (area < 350 * 200) {
                                    setZ("up", 1);    //缩(放大)
                                } else if (area < 350 * 300 && minNum > 0) {  //进行微调，缩（放大）
                                    System.out.println("Z值开始微调放大");
                                    PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 0);
                                    PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 1);
                                    minNum--;
                                }
//                                else if (area > 350 * 300 && minNum > 0) {
//                                    System.out.println("Z值开始微调缩小");
//                                    PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 0);
//                                    PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 1);
//                                    minNum--;
//                                }
                            }else {
                                lastSpeed = speed;
                            }

                        }

                    }

                }
            } catch (NumberFormatException e) {
                e.printStackTrace();
            }
        }
//                                System.out.println(object[0]);
    }

    /**
     * 点动控制摄像头
     * @param cmd
     * @return
     */
    public boolean setContral(String cmd) {
        if ("l".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_LEFT, 0);
            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_LEFT, 1);
            System.out.println("已经向左移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("r".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_RIGHT, 0);
            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_RIGHT, 1);
            System.out.println("已经向右移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("u".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_UP, 0);
            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_UP, 1);
            System.out.println("已经向上移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("d".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_DOWN, 0);
            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_DOWN, 1);
            System.out.println("已经向下移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("lu".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.UP_LEFT, 0);      /* 云台以SS的速度上仰和左转 */
            PTZControlAll(m_lRealHandle, HCNetSDK.UP_LEFT, 1);
            System.out.println("已经向左上移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("ld".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_LEFT, 0);      /* 云台以SS的速度下仰和左转 */
            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_LEFT, 1);
            System.out.println("已经向左下移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("ru".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.UP_RIGHT, 0);      /* 云台以SS的速度上仰和右转 */
            PTZControlAll(m_lRealHandle, HCNetSDK.UP_RIGHT, 1);
            System.out.println("已经向右上移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("rd".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_RIGHT, 0);      /* 云台以SS的速度下仰和右转 */
            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_RIGHT, 1);
            System.out.println("已经向右下移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else {
            return false;
        }
        if ("right".equals(direction) && jComboBoxSpeed.getSelectedIndex() >= 5) {
            try {
                Thread.sleep(700);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        lastControl = cmd;
        return true;
    }

    /**
     *连续移动
     * @param cmd
     * @return
     */
    public boolean setContral2(String cmd) {
        if ("l".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_LEFT, 0);
//            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_LEFT, 1);
            System.out.println("已经向左连续移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("r".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_RIGHT, 0);
//            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_RIGHT, 1);
            System.out.println("已经向右连续移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("u".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_UP, 0);
//            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_UP, 1);
            System.out.println("已经向上连续移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("d".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_DOWN, 0);
//            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_DOWN, 1);
            System.out.println("已经向下连续移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("lu".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.UP_LEFT, 0);      /* 云台以SS的速度上仰和左转 */
//            PTZControlAll(m_lRealHandle, HCNetSDK.UP_LEFT, 1);
            System.out.println("已经向左上连续移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("ld".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_LEFT, 0);      /* 云台以SS的速度下仰和左转 */
//            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_LEFT, 1);
            System.out.println("已经向左下连续移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("ru".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.UP_RIGHT, 0);      /* 云台以SS的速度上仰和右转 */
//            PTZControlAll(m_lRealHandle, HCNetSDK.UP_RIGHT, 1);
            System.out.println("已经向右上连续移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else if ("rd".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_RIGHT, 0);      /* 云台以SS的速度下仰和右转 */
//            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_RIGHT, 1);
            System.out.println("已经向右下连续移动,速度=" + jComboBoxSpeed.getSelectedIndex());
        } else {
            return false;
        }
        lastControl = cmd;
        return true;
    }

    /**
     * 停止连续移动
     * @param cmd
     * @return
     */
    public boolean stopContral2(String cmd) {
        if ("l".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_LEFT, 1);
            System.out.println("停止向左连续移动" + jComboBoxSpeed.getSelectedIndex());
        } else if ("r".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.PAN_RIGHT, 1);
            System.out.println("停止向右连续移动" + jComboBoxSpeed.getSelectedIndex());
        } else if ("u".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_UP, 1);
            System.out.println("停止向上连续移动" + jComboBoxSpeed.getSelectedIndex());
        } else if ("d".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.TILT_DOWN, 1);
            System.out.println("停止向下连续移动" + jComboBoxSpeed.getSelectedIndex());
        } else if ("lu".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.UP_LEFT, 1);
            System.out.println("停止向左上连续移动" + jComboBoxSpeed.getSelectedIndex());
        } else if ("ld".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_LEFT, 1);
            System.out.println("停止向左下连续移动" + jComboBoxSpeed.getSelectedIndex());
        } else if ("ru".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.UP_RIGHT, 1);
            System.out.println("停止向右上连续移动" + jComboBoxSpeed.getSelectedIndex());
        } else if ("rd".equals(cmd)) {
            PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_RIGHT, 1);
            System.out.println("停止向右下连续移动" + jComboBoxSpeed.getSelectedIndex());
        } else {
            return false;
        }
        return true;
    }

    /**
     * 每隔一段时间设置captureFlag的值
     */
    public void setFlag(int P) {
        if (captureFlag && (midCaptureNum > 0 || rightCaptureNum > 0)) {
            captureFlag = false;
            if (P >= 260 && P <= 285 && rightCaptureNum > 0) {
                rightCaptureNum--;
                capturePicture();   //截图
            } else if (P < 260 && midCaptureNum > 0) {
                capturePicture();   //截图
                midCaptureNum--;
            } else {
                captureFlag = true;
            }
            System.out.println("剩余中间截图数 = " + midCaptureNum + ", 右截图数 = " + rightCaptureNum);

//            setContral("last");
//                System.out.println("PTZ还原成功！");
//            } else {
//                System.out.println("PTZ还原失败！");
        }

    }

    /**
     * 抓图，格式.bmp
     */
    public void capturePicture() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                String pictureName = tf.format(new Date()); //获取系统时间当图片名 hhMMss
                String hour = pictureName.substring(0, 2);
                String minute = pictureName.substring(2, 4);
                String seconds = pictureName.substring(4);
                String date = AccurateBasic.df.format(new Date());  //获取系统日期 yyyymmdd
                pictureName = hour + "-" + minute + "-" + seconds;
                File dir = new File(AccurateBasic.path + "/" + date);   //存放文件的目录
                // 一、检查放置文件的文件夹路径是否存在，不存在则创建
                if (!dir.exists()) {
                    dir.mkdirs();// mkdirs创建多级目录
                }
                //bmp格式捉图
                boolean b = hCNetSDK.NET_DVR_CapturePicture(m_lRealHandle, AccurateBasic.path + "/" + date + "/" + pictureName + ".bmp");
                if (b) {
                    try {
                        showJframFlag = jComboBoxShowJfram.getSelectedIndex() == 0;
                        int selectOcrIndex = jComboBoxOCRAPI.getSelectedIndex();    //选择ocr接口
                        System.out.println("抓图成功！百度ocr" + jComboBoxOCRAPI.getSelectedItem() + "接口正在识别图片文字中...");
                        map.clear();
                        map.put("x1", x1);
                        map.put("y1", y1);
                        map.put("x2", x2);
                        map.put("y2", y2);
                        Thread.sleep(2000);
                        //捉拍的文件过大，不利于保存。进行缩小
                        PictureScale.scale(AccurateBasic.path + "/" + date + "/" + pictureName + ".bmp",
                                AccurateBasic.path + "/" + date + "/" + pictureName + ".bmp", 1, true);
                        if (selectOcrIndex == 0) {
                            //调用高精度接口识别图片文字
                            Sample.HeightSample(pictureName, "bmp");
                        } else if (selectOcrIndex == 1) {
//                            调用高精度含位置信息的ocr接口
                            Sample.HeihgtSampleToMap(pictureName, "bmp", map);
                        } else if (selectOcrIndex == 2) {
                            //网路识别图片接口
                            Sample.netPicture(pictureName, "bmp");
                        }
                        //调用高精度接口识别图片文字
//                        String result = AccurateBasic.accurateBasic(pictureName, "bmp");    //.bmp格式的图片
//
//                        Sample.HeightSample(pictureName, "bmp");

                        //调用高精度含位置信息的ocr接口
//                        Sample.HeihgtSampleToMap(pictureName,"bmp",map);

                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                } else {
                    System.out.println("抓图失败！");
                }
                captureFlag = true;
            }
        }).start();
    }

    /**
     * 定点移动(x,y)
     *
     * @param x
     * @param y
     */
    public void moveToMap(float x, float y) {
        //获取PTZ相关信息
        HCNetSDK.NET_DVR_PTZPOS m_ptzPosCurrent = new HCNetSDK.NET_DVR_PTZPOS();

        IntByReference ibrBytesReturned = new IntByReference(0);

        Pointer pioint = m_ptzPosCurrent.getPointer();

        hCNetSDK.NET_DVR_GetDVRConfig(ClientDemo.lUserID, HCNetSDK.NET_DVR_GET_PTZPOS, new NativeLong(1), pioint, m_ptzPosCurrent.size(), ibrBytesReturned);
        m_ptzPosCurrent.read();
        m_ptzPosCurrent.wAction = 1;
        float infoP = 0;
        float infoT = 0;
        infoP = (x - 630) / 34.21F;
        infoT = (y - 480) / 34.21F;
        int str1 = (int) (((float) m_ptzPosCurrent.wPanPos + infoP) * 10);
        m_ptzPosCurrent.wPanPos = (short) HexToDecMa(str1);
        int str2 = (int) (((float) m_ptzPosCurrent.wTiltPos - infoT) * 10);

        if (str2 < 0) {
            //  return;
        }
        if (str1 < 0) {
            str1 = (str1) + 3600;
        }
        if (str1 > 3600) {
            str1 = (str1) - 3600;
        }

        m_ptzPosCurrent.wTiltPos = (short) (HexToDecMa(str2));
//        m_ptzPosCurrent.wZoomPos = 200;
        m_ptzPosCurrent.write();
        if (hCNetSDK.NET_DVR_SetDVRConfig(ClientDemo.lUserID, HCNetSDK.NET_DVR_SET_PTZPOS, new NativeLong(1), pioint, m_ptzPosCurrent.size())) {
            System.out.println("定位到点成功");
        } else {
            System.out.println("定位到点失败！");
        }
    }

    /**
     * 定点移动（P,T,Z）
     * @param p
     * @param t
     * @param z
     * @return
     */
    public boolean moveControl(int p, int t, int z) {
        HCNetSDK.NET_DVR_PTZPOS m_ptzPosCurrent = new HCNetSDK.NET_DVR_PTZPOS();
        IntByReference ibrBytesReturned = new IntByReference(0);
        Pointer pioint = m_ptzPosCurrent.getPointer();
        hCNetSDK.NET_DVR_GetDVRConfig(ClientDemo.lUserID, HCNetSDK.NET_DVR_GET_PTZPOS, new NativeLong(1), pioint, m_ptzPosCurrent.size(), ibrBytesReturned);
        m_ptzPosCurrent.read();
        int m_iPara1 = DEC2HEX_doc(p * 10);
        int m_iPara2 = DEC2HEX_doc(t * 10);
//        m_iPara2 = m_iPara2 > 300 ? (m_iPara2 - 359) : m_iPara2;
        int m_iPara3 = DEC2HEX_doc(z * 10);
        m_ptzPosCurrent.wPanPos = (short) m_iPara1;
        m_ptzPosCurrent.wTiltPos = (short) m_iPara2;
        m_ptzPosCurrent.wZoomPos = (short) m_iPara3;
        m_ptzPosCurrent.write();
//        System.out.println(m_ptzPosCurrent.wZoomPos);
        return hCNetSDK.NET_DVR_SetDVRConfig(ClientDemo.lUserID, HCNetSDK.NET_DVR_SET_PTZPOS, new NativeLong(1), pioint, m_ptzPosCurrent.size());
    }

    /**
     * 获取云台的PTZ参数
     *
     * @return
     */
    public HashMap<Integer, Integer> getPTZ() {
        //获取PTZ相关信息
//        HCNetSDK.NET_DVR_PTZPOS m_ptzPosCurrent = new HCNetSDK.NET_DVR_PTZPOS();
//
//        IntByReference ibrBytesReturned = new IntByReference(0);
//
//        Pointer pioint = m_ptzPosCurrent.getPointer();
//
        boolean b = hCNetSDK.NET_DVR_GetDVRConfig(ClientDemo.lUserID, HCNetSDK.NET_DVR_GET_PTZPOS, new NativeLong(1), pioint, m_ptzPosCurrent.size(), ibrBytesReturned);
//        System.out.println("获取相机配置："+b);
        m_ptzPosCurrent.read();
//        System.out.println(m_ptzPosCurrent);
        int m_iPara1 = HexToDecMa(m_ptzPosCurrent.wPanPos) / 10;
        int m_iPara2 = (HexToDecMa(m_ptzPosCurrent.wTiltPos) / 10);
        m_iPara2 = m_iPara2 > 300 ? (m_iPara2 - 359) : m_iPara2;
        int m_iPara3 = HexToDecMa(m_ptzPosCurrent.wZoomPos) / 10;
//        System.out.println("PTZ水平参数(P):" + m_iPara1);
//        System.out.println("PTZ垂直参数(T):" + m_iPara2);
//        System.out.println("PTZ变倍参数(Z):" + m_iPara3);
        HashMap<Integer, Integer> map = new HashMap<>();
        map.put(1, m_iPara1);   //1存P
        map.put(2, m_iPara2);   //2存T
        map.put(3, m_iPara3);   //3存Z
        return map;
    }

    /**
     * 设置变焦(T)
     */
    public boolean setZ(String cmd, int num) {
        if (setZflag) {
            setZflag = false;
//            HCNetSDK.NET_DVR_PTZPOS m_ptzPosCurrent = new HCNetSDK.NET_DVR_PTZPOS();
//            IntByReference ibrBytesReturned = new IntByReference(0);
//            Pointer pioint = m_ptzPosCurrent.getPointer();
//
            hCNetSDK.NET_DVR_GetDVRConfig(ClientDemo.lUserID, HCNetSDK.NET_DVR_GET_PTZPOS, new NativeLong(1), pioint, m_ptzPosCurrent.size(), ibrBytesReturned);
            m_ptzPosCurrent.read();
            int m_iPara1 = HexToDecMa(m_ptzPosCurrent.wPanPos) / 10;
            int m_iPara2 = (HexToDecMa(m_ptzPosCurrent.wTiltPos) / 10);
            m_iPara2 = m_iPara2 > 300 ? (m_iPara2 - 359) : m_iPara2;
            int m_iPara3 = HexToDecMa(m_ptzPosCurrent.wZoomPos) / 10;
            if ("up".equals(cmd)) {
                int Z = DEC2HEX_doc(((m_iPara3 + num) * 10));
                System.out.println("倍数+1");
                m_ptzPosCurrent.wZoomPos = (short) Z;
            } else if ("down".equals(cmd)) {
                int Z = DEC2HEX_doc(((m_iPara3 - num) * 10));
                m_ptzPosCurrent.wZoomPos = (short) Z;
                System.out.println("倍数-1");
            } else if ("mid".equals(cmd)) {
//            int P = DEC2HEX_doc(1900);
//            int T = DEC2HEX_doc(110);
//            lastZ = m_ptzPosCurrent.wZoomPos;
                int Z = DEC2HEX_doc((midZ * 10));
                m_ptzPosCurrent.wZoomPos = (short) Z;
                System.out.println("已经放大到" + midZ);
            } else {
//            m_ptzPosCurrent.wZoomPos = (short) lastZ;
                m_ptzPosCurrent.wZoomPos = (short) DEC2HEX_doc(num * 10);
                System.out.println("已经放大到" + num);
//            setContral(lastControl);
            }
            m_ptzPosCurrent.write();
//        System.out.println(m_ptzPosCurrent.wZoomPos);
            boolean b = hCNetSDK.NET_DVR_SetDVRConfig(ClientDemo.lUserID, HCNetSDK.NET_DVR_SET_PTZPOS, new NativeLong(1), pioint, m_ptzPosCurrent.size());
//            System.out.println("变焦："+ b);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            setZflag = true;
        }
        return false;
    }


    //相机的角度参数是十六进制,需要和十进制来回切换
    static int HexToDecMa(int wHex)//十六进制转十进制
    {
        return (wHex / 4096) * 1000 + ((wHex % 4096) / 256) * 100 + ((wHex % 256) / 16) * 10 + (wHex % 16);
    }

    static int DEC2HEX_doc(int x)//十进制转十六进制
    {
        return (x / 1000) * 4096 + ((x % 1000) / 100) * 256 + ((x % 100) / 10) * 16 + x % 10;
    }


    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelPTZ = new javax.swing.JPanel();
        jButtonAux2 = new javax.swing.JButton();
        jButtonAux1 = new javax.swing.JButton();
        jButton1IrisClose = new javax.swing.JButton();
        jButtonFocusFar = new javax.swing.JButton();
        jButton1ZoomOut = new javax.swing.JButton();
        jButtonRight = new javax.swing.JButton();
        jButtonRightDown = new javax.swing.JButton();
        jButtonRightUp = new javax.swing.JButton();
        jButtonUp = new javax.swing.JButton();
        jButtonAuto = new javax.swing.JButton();
        jButtondown = new javax.swing.JButton();
        jButtonLeftUp = new javax.swing.JButton();
        jButtonLeft = new javax.swing.JButton();
        jButtonLeftDown = new javax.swing.JButton();
        jButtonZoomIn = new javax.swing.JButton();
        jButton1FocusNear = new javax.swing.JButton();
        jButton1IrisOpen = new javax.swing.JButton();
        jButtonLight = new javax.swing.JButton();
        jComboBoxAutoControl = new javax.swing.JComboBox();
        jComboBoxOCRAPI = new javax.swing.JComboBox();
        jComboBoxValue = new javax.swing.JComboBox();
        jComboBoxShowJfram = new javax.swing.JComboBox();
        jComboBoxDark = new javax.swing.JComboBox();
        jButtonFanPwron = new javax.swing.JButton();
        jButtonHeater = new javax.swing.JButton();
        jButtonWiperPwron = new javax.swing.JButton();
        jButtonMoveLeft = new javax.swing.JButton();
        jButtonMoveRight = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jComboBoxSpeed = new javax.swing.JComboBox();
        jPanel1 = new javax.swing.JPanel();
        jComboBoxPreset = new javax.swing.JComboBox();
        jButtonGotoPreset = new javax.swing.JButton();
        jButtonSetPreset = new javax.swing.JButton();
        jButtonDeletePreset = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jComboBoxSeq = new javax.swing.JComboBox();
        jButtonGotoSeq = new javax.swing.JButton();
        jButtonSetSeq = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jButtonTrackStop = new javax.swing.JButton();
        jButtonTrackRun = new javax.swing.JButton();
        jButtonTrackStart = new javax.swing.JButton();
        jPanelVideoPara = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jButtonDefault = new javax.swing.JButton();
        jSliderVolume = new javax.swing.JSlider();
        jSliderHue = new javax.swing.JSlider();
        jSliderSaturation = new javax.swing.JSlider();
        jSliderContrast = new javax.swing.JSlider();
        jSliderBright = new javax.swing.JSlider();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("云台控制");

        jPanelPTZ.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jButtonAux2.setText("辅助2");
        jButtonAux2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonAux2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAux2ActionPerformed(evt);
            }
        });

        jButtonAux1.setText("辅助");
        jButtonAux1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonAux1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAux1ActionPerformed(evt);
            }
        });

        jButton1IrisClose.setText("小");
        jButton1IrisClose.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButton1IrisClose.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton1IrisCloseMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButton1IrisCloseMouseReleased(evt);
            }
        });

        jButtonFocusFar.setText("远");
        jButtonFocusFar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonFocusFar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonFocusFarMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonFocusFarMouseReleased(evt);
            }
        });

        jButton1ZoomOut.setText("伸");
        jButton1ZoomOut.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButton1ZoomOut.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton1ZoomOutMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButton1ZoomOutMouseReleased(evt);
            }
        });

        jButtonRight.setText("右");
        jButtonRight.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonRight.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonRightMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonRightMouseReleased(evt);
            }
        });

        jButtonRightDown.setText("右下");
        jButtonRightDown.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonRightDown.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonRightDownMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonRightDownMouseReleased(evt);
            }
        });

        jButtonRightUp.setText("右上");
        jButtonRightUp.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonRightUp.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonRightUpMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonRightUpMouseReleased(evt);
            }
        });

        jButtonUp.setText("上");
        jButtonUp.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonUp.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonUpMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonUpMouseReleased(evt);
            }
        });

        jButtonAuto.setText("自动");
        jButtonAuto.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAutoActionPerformed(evt);
            }
        });

        jButtondown.setText("下");
        jButtondown.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtondown.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtondownMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtondownMouseReleased(evt);
            }
        });

        jButtonLeftUp.setText("左上");
        jButtonLeftUp.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonLeftUp.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonLeftUpMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonLeftUpMouseReleased(evt);
            }
        });

        jButtonLeft.setText("左");
        jButtonLeft.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonLeft.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonLeftMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonLeftMouseReleased(evt);
            }
        });

        jButtonLeftDown.setText("左下");
        jButtonLeftDown.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonLeftDown.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonLeftDownMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonLeftDownMouseReleased(evt);
            }
        });

        jButtonZoomIn.setText("缩");
        jButtonZoomIn.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonZoomIn.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButtonZoomInMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButtonZoomInMouseReleased(evt);
            }
        });

        jButton1FocusNear.setText("近");
        jButton1FocusNear.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButton1FocusNear.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton1FocusNearMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButton1FocusNearMouseReleased(evt);
            }
        });

        jButton1IrisOpen.setText("大");
        jButton1IrisOpen.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButton1IrisOpen.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jButton1IrisOpenMousePressed(evt);
            }

            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jButton1IrisOpenMouseReleased(evt);
            }
        });

        jButtonLight.setText("灯光");
        jButtonLight.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonLight.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonLightActionPerformed(evt);
            }
        });

        jButtonMoveLeft.setText("左边");
        jButtonMoveLeft.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonMoveLeft.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                moveControl(150, 16, 1);
                //设置区域边界线
                direction = "left";
                leftUpLine = 160;   //放大区域的左边界线
                rightUpLine = 210;  //放大区域的右边界线
                lScreenshot = 185;  //截图区域左界线
                rScreenshot = 205;  //截图区域右界线
            }
        });

        jButtonMoveRight.setText("右边");
        jButtonMoveRight.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonMoveRight.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                moveControl(250, 7, 1);
                //设置区域边界线
                direction = "right";
                leftUpLine = 185;   //放大区域的左边界线
                rightUpLine = 220;  //放大区域的额右边界线
                lScreenshot = 190;  //截图区域左界线
                rScreenshot = 208;  //截图区域右界线

            }
        });

        jButtonFanPwron.setText("风扇");
        jButtonFanPwron.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonFanPwron.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonFanPwronActionPerformed(evt);
            }
        });

        jButtonHeater.setText("加热");
        jButtonHeater.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonHeater.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonHeaterActionPerformed(evt);
            }
        });

        jButtonWiperPwron.setText("雨刷");
        jButtonWiperPwron.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonWiperPwron.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonWiperPwronActionPerformed(evt);
            }
        });

        jLabel1.setText("光圈");

        jLabel3.setText("聚焦");

        jLabel2.setText("调焦");

        jLabel4.setText("云台速度");

        jLabel14.setText("yolov5联动");

        jLabel15.setText("边界");

        jLabel16.setText("ocr接口");

        jLabel17.setText("联动阈值");

        jLabel18.setText("显示ocr结果");

        jLabel19.setText("夜间捉拍");

        jComboBoxSpeed.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"默认", "1", "2", "3", "4", "5", "6", "7"}));


        jComboBoxAutoControl.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"开", "关"}));

        jComboBoxOCRAPI.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"高精度", "高精度(含坐标)", "网路图片"}));

        jComboBoxValue.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9"}));

        jComboBoxShowJfram.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"yes", "no"}));

        jComboBoxDark.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"关", "开"}));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("预置点"));

        jButtonGotoPreset.setText("调用");
        jButtonGotoPreset.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonGotoPreset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGotoPresetActionPerformed(evt);
            }
        });

        jButtonSetPreset.setText("设置");
        jButtonSetPreset.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonSetPreset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSetPresetActionPerformed(evt);
            }
        });

        jButtonDeletePreset.setText("删除");
        jButtonDeletePreset.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonDeletePreset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDeletePresetActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jComboBoxPreset, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButtonGotoPreset, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButtonSetPreset)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButtonDeletePreset))
        );
        jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jComboBoxPreset, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonGotoPreset, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonSetPreset, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonDeletePreset, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addContainerGap())
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("巡航路径"));

        jButtonGotoSeq.setText("调用");
        jButtonGotoSeq.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonGotoSeq.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGotoSeqActionPerformed(evt);
            }
        });

        jButtonSetSeq.setText("设置");
        jButtonSetSeq.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonSetSeq.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSetSeqActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                                .addComponent(jComboBoxSeq, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButtonGotoSeq, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonSetSeq, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jComboBoxSeq, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonSetSeq, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonGotoSeq, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("轨道记录"));

        jButtonTrackStop.setText("停止");
        jButtonTrackStop.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonTrackStop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTrackStopActionPerformed(evt);
            }
        });

        jButtonTrackRun.setText("运行");
        jButtonTrackRun.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonTrackRun.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTrackRunActionPerformed(evt);
            }
        });

        jButtonTrackStart.setText("开始");
        jButtonTrackStart.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jButtonTrackStart.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTrackStartActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                                .addContainerGap(11, Short.MAX_VALUE)
                                .addComponent(jButtonTrackStart, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButtonTrackStop, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButtonTrackRun, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(4, 4, 4))
        );
        jPanel3Layout.setVerticalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jButtonTrackStop, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonTrackStart, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonTrackRun, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addContainerGap())
        );

        javax.swing.GroupLayout jPanelPTZLayout = new javax.swing.GroupLayout(jPanelPTZ);
        jPanelPTZ.setLayout(jPanelPTZLayout);
        jPanelPTZLayout.setHorizontalGroup(
                jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jButtonLeftUp, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonUp, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonRightUp, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jButtonLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonRight, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jButtonLeftDown, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtondown, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonRightDown, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jButtonZoomIn, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(20, 20, 20)
                                                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButton1ZoomOut, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jButton1FocusNear, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(20, 20, 20)
                                                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonFocusFar, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jButton1IrisOpen, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(20, 20, 20)
                                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButton1IrisClose, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jButtonLight, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonWiperPwron, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonAux1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jButtonFanPwron, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonHeater, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonAux2, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jLabel4)
                                                .addGap(18, 18, 18)
                                                .addComponent(jComboBoxSpeed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jLabel14)
                                                .addGap(18, 18, 18)
                                                .addComponent(jComboBoxAutoControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jLabel15)
                                                .addGap(18, 18, 18)
                                                .addComponent(jButtonMoveLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(10, 10, 10)
                                                .addComponent(jButtonMoveRight, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jLabel16)
                                                .addGap(10, 10, 10)
                                                .addComponent(jComboBoxOCRAPI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jLabel17)
                                                .addGap(18, 18, 18)
                                                .addComponent(jComboBoxValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jLabel18)
                                                .addGap(18, 18, 18)
                                                .addComponent(jComboBoxShowJfram, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                                .addComponent(jLabel19)
                                                .addGap(18, 18, 18)
                                                .addComponent(jComboBoxDark, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                ))
                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addContainerGap())
                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                .addComponent(jPanel2, 0, 167, Short.MAX_VALUE)
                                .addContainerGap())
                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())
        );
        jPanelPTZLayout.setVerticalGroup(
                jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelPTZLayout.createSequentialGroup()
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButtonLeftUp, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonUp, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonRightUp, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButtonLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonRight, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButtonLeftDown, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtondown, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonRightDown, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButtonZoomIn, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel2)
                                        .addComponent(jButton1ZoomOut, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButton1FocusNear, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel3)
                                        .addComponent(jButtonFocusFar, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButton1IrisOpen, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel1)
                                        .addComponent(jButton1IrisClose, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(10, 10, 10)
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButtonLight, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonWiperPwron, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonAux1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jButtonFanPwron, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonHeater, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonAux2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jComboBoxSpeed, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel4))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jComboBoxAutoControl, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel14))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jButtonMoveLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jButtonMoveRight, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel15))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jComboBoxOCRAPI, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel16))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jComboBoxValue, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel17))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jComboBoxShowJfram, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel18))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanelPTZLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jComboBoxDark, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel19))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 25, Short.MAX_VALUE)
                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanelVideoPara.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanelVideoPara.setLayout(null);

        jLabel5.setText("对比度");
        jPanelVideoPara.add(jLabel5);
        jLabel5.setBounds(0, 50, 50, 15);

        jLabel6.setText("饱和度");
        jPanelVideoPara.add(jLabel6);
        jLabel6.setBounds(0, 80, 50, 15);

        jLabel7.setText("色度");
        jPanelVideoPara.add(jLabel7);
        jLabel7.setBounds(0, 110, 50, 15);

        jLabel8.setText("音量");
        jPanelVideoPara.add(jLabel8);
        jLabel8.setBounds(0, 140, 50, 15);

        jLabel9.setText("亮度");
        jPanelVideoPara.add(jLabel9);
        jLabel9.setBounds(0, 20, 50, 15);

        jButtonDefault.setText("默认值");
        jButtonDefault.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDefaultActionPerformed(evt);
            }
        });
        jPanelVideoPara.add(jButtonDefault);
        jButtonDefault.setBounds(50, 200, 100, 23);

        jSliderVolume.setMinimum(1);
        jSliderVolume.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderVolumeStateChanged(evt);
            }
        });
        jPanelVideoPara.add(jSliderVolume);
        jSliderVolume.setBounds(60, 140, 110, 20);

        jSliderHue.setMaximum(10);
        jSliderHue.setMinimum(1);
        jSliderHue.setValue(6);
        jSliderHue.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderHueStateChanged(evt);
            }
        });
        jPanelVideoPara.add(jSliderHue);
        jSliderHue.setBounds(60, 110, 110, 20);

        jSliderSaturation.setMaximum(10);
        jSliderSaturation.setMinimum(1);
        jSliderSaturation.setValue(6);
        jSliderSaturation.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderSaturationStateChanged(evt);
            }
        });
        jPanelVideoPara.add(jSliderSaturation);
        jSliderSaturation.setBounds(60, 80, 110, 20);

        jSliderContrast.setMaximum(10);
        jSliderContrast.setMinimum(1);
        jSliderContrast.setValue(6);
        jSliderContrast.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderContrastStateChanged(evt);
            }
        });
        jPanelVideoPara.add(jSliderContrast);
        jSliderContrast.setBounds(60, 50, 110, 20);

        jSliderBright.setMaximum(10);
        jSliderBright.setMinimum(1);
        jSliderBright.setValue(6);
        jSliderBright.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jSliderBrightStateChanged(evt);
            }
        });
        jPanelVideoPara.add(jSliderBright);
        jSliderBright.setBounds(60, 20, 110, 20);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jPanelPTZ, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jPanelVideoPara, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jPanelPTZ, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGap(18, 18, 18)
                                .addComponent(jPanelVideoPara, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /*************************************************
     函数:       左上 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonLeftUpMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLeftUpMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.UP_LEFT, 0);
    }//GEN-LAST:event_jButtonLeftUpMousePressed

    private void jButtonLeftUpMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLeftUpMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.UP_LEFT, 1);
    }//GEN-LAST:event_jButtonLeftUpMouseReleased

    /*************************************************
     函数:       右下 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonRightDownMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonRightDownMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_RIGHT, 0);
    }//GEN-LAST:event_jButtonRightDownMousePressed

    private void jButtonRightDownMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonRightDownMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_RIGHT, 1);
    }//GEN-LAST:event_jButtonRightDownMouseReleased

    /*************************************************
     函数:       上 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonUpMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonUpMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.TILT_UP, 0);
    }//GEN-LAST:event_jButtonUpMousePressed

    private void jButtonUpMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonUpMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.TILT_UP, 1);
    }//GEN-LAST:event_jButtonUpMouseReleased

    /*************************************************
     函数:       下 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtondownMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtondownMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.TILT_DOWN, 0);
    }//GEN-LAST:event_jButtondownMousePressed

    private void jButtondownMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtondownMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.TILT_DOWN, 1);
    }//GEN-LAST:event_jButtondownMouseReleased

    /*************************************************
     函数:       右上 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonRightUpMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonRightUpMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.UP_RIGHT, 0);
    }//GEN-LAST:event_jButtonRightUpMousePressed

    private void jButtonRightUpMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonRightUpMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.UP_RIGHT, 1);
    }//GEN-LAST:event_jButtonRightUpMouseReleased

    /*************************************************
     函数:       左下 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonLeftDownMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLeftDownMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_LEFT, 0);
    }//GEN-LAST:event_jButtonLeftDownMousePressed

    private void jButtonLeftDownMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLeftDownMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.DOWN_LEFT, 1);
    }//GEN-LAST:event_jButtonLeftDownMouseReleased

    /*************************************************
     函数:       左 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonLeftMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLeftMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.PAN_LEFT, 0);
    }//GEN-LAST:event_jButtonLeftMousePressed

    private void jButtonLeftMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonLeftMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.PAN_LEFT, 1);
    }//GEN-LAST:event_jButtonLeftMouseReleased

    /*************************************************
     函数:       右 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonRightMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonRightMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.PAN_RIGHT, 0);
    }//GEN-LAST:event_jButtonRightMousePressed

    private void jButtonRightMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonRightMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.PAN_RIGHT, 1);
    }//GEN-LAST:event_jButtonRightMouseReleased

    /*************************************************
     函数:       调焦 缩 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonZoomInMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonZoomInMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 0);
    }//GEN-LAST:event_jButtonZoomInMousePressed

    private void jButtonZoomInMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonZoomInMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_IN, 1);
    }//GEN-LAST:event_jButtonZoomInMouseReleased

    /*************************************************
     函数:       调焦 伸 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButton1ZoomOutMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1ZoomOutMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 0);
    }//GEN-LAST:event_jButton1ZoomOutMousePressed

    private void jButton1ZoomOutMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1ZoomOutMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.ZOOM_OUT, 1);
    }//GEN-LAST:event_jButton1ZoomOutMouseReleased

    /*************************************************
     函数:       聚焦 近 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButton1FocusNearMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1FocusNearMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.FOCUS_NEAR, 0);
    }//GEN-LAST:event_jButton1FocusNearMousePressed

    private void jButton1FocusNearMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1FocusNearMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.FOCUS_NEAR, 1);
    }//GEN-LAST:event_jButton1FocusNearMouseReleased

    /*************************************************
     函数:       聚焦 远 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButtonFocusFarMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonFocusFarMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.FOCUS_FAR, 0);
    }//GEN-LAST:event_jButtonFocusFarMousePressed

    private void jButtonFocusFarMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonFocusFarMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.FOCUS_FAR, 1);
    }//GEN-LAST:event_jButtonFocusFarMouseReleased

    /*************************************************
     函数:       光圈 开 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButton1IrisOpenMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1IrisOpenMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.IRIS_OPEN, 0);
    }//GEN-LAST:event_jButton1IrisOpenMousePressed

    private void jButton1IrisOpenMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1IrisOpenMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.IRIS_OPEN, 1);
    }//GEN-LAST:event_jButton1IrisOpenMouseReleased

    /*************************************************
     函数:       光圈 关 按钮的press和release响应函数
     函数描述:	云台控制函数
     *************************************************/
    private void jButton1IrisCloseMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1IrisCloseMousePressed
        PTZControlAll(m_lRealHandle, HCNetSDK.IRIS_CLOSE, 0);
    }//GEN-LAST:event_jButton1IrisCloseMousePressed

    private void jButton1IrisCloseMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1IrisCloseMouseReleased
        PTZControlAll(m_lRealHandle, HCNetSDK.IRIS_CLOSE, 1);
    }//GEN-LAST:event_jButton1IrisCloseMouseReleased

    /*************************************************
     函数:       "自动"按钮  双击响应函数
     函数描述:	云台控制函数  云台开始/停止左右自动扫描
     *************************************************/
    private void jButtonAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAutoActionPerformed
        int iSpeed = jComboBoxSpeed.getSelectedIndex();
        if (!m_bAutoOn) {
            if (iSpeed >= 1) {
                hCNetSDK.NET_DVR_PTZControlWithSpeed(m_lRealHandle, HCNetSDK.PAN_AUTO, 0, iSpeed);
            } else {
                hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.PAN_AUTO, 0);
            }
            jButtonAuto.setText("停止");
            m_bAutoOn = true;
        } else {
            if (iSpeed >= 1) {
                hCNetSDK.NET_DVR_PTZControlWithSpeed(m_lRealHandle, HCNetSDK.PAN_AUTO, 1, iSpeed);
            } else {
                hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.PAN_AUTO, 1);
            }
            jButtonAuto.setText("自动");
            m_bAutoOn = false;
        }
    }//GEN-LAST:event_jButtonAutoActionPerformed

    /*************************************************
     函数:       "灯光"按钮  双击响应函数
     函数描述:	云台控制函数  打开/关闭灯光
     *************************************************/
    private void jButtonLightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLightActionPerformed
        if (!m_bLightOn) {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.LIGHT_PWRON, 0);
            jButtonLight.setText("关灯");
            m_bLightOn = true;
        } else {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.LIGHT_PWRON, 1);
            jButtonLight.setText("灯光");
            m_bLightOn = false;
        }
    }//GEN-LAST:event_jButtonLightActionPerformed

    /*************************************************
     函数:       "雨刷"按钮  双击响应函数
     函数描述:	云台控制函数  开始/停止雨刷
     *************************************************/
    private void jButtonWiperPwronActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonWiperPwronActionPerformed
        if (!m_bWiperOn) {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.WIPER_PWRON, 0);
            jButtonWiperPwron.setText("雨停");
            m_bWiperOn = true;
        } else {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.WIPER_PWRON, 1);
            jButtonWiperPwron.setText("雨刷");
            m_bWiperOn = false;
        }
    }//GEN-LAST:event_jButtonWiperPwronActionPerformed

    /*************************************************
     函数:       "风扇"按钮  双击响应函数
     函数描述:	云台控制函数  开始/停止 风扇
     *************************************************/
    private void jButtonFanPwronActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFanPwronActionPerformed
        if (!m_bFanOn) {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.FAN_PWRON, 0);
            jButtonFanPwron.setText("停风");
            m_bFanOn = true;
        } else {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.FAN_PWRON, 1);
            jButtonFanPwron.setText("风扇");
            m_bFanOn = false;
        }
    }//GEN-LAST:event_jButtonFanPwronActionPerformed

    /*************************************************
     函数:       "加热"按钮  双击响应函数
     函数描述:	云台控制函数  开始/停止 加热
     *************************************************/
    private void jButtonHeaterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonHeaterActionPerformed
        if (!m_bHeaterOn) {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.HEATER_PWRON, 0);
            jButtonHeater.setText("停止");
            m_bHeaterOn = true;
        } else {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.HEATER_PWRON, 1);
            jButtonHeater.setText("加热");
            m_bHeaterOn = false;
        }
    }//GEN-LAST:event_jButtonHeaterActionPerformed

    /*************************************************
     函数:       "辅助1"按钮  双击响应函数
     函数描述:	云台控制函数  开始/停止 辅助1
     *************************************************/
    private void jButtonAux1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAux1ActionPerformed
        if (!m_bAuxOn1) {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.AUX_PWRON1, 0);
            jButtonAux1.setText("停止1");
            m_bAuxOn1 = true;
        } else {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.AUX_PWRON1, 1);
            jButtonAux1.setText("辅助1");
            m_bAuxOn1 = false;
        }
    }//GEN-LAST:event_jButtonAux1ActionPerformed

    /*************************************************
     函数:       "辅助2"按钮  双击响应函数
     函数描述:	云台控制函数  开始/停止 辅助2
     *************************************************/
    private void jButtonAux2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAux2ActionPerformed
        if (!m_bAuxOn2) {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.AUX_PWRON1, 0);
            jButtonAux2.setText("停止2");
            m_bAuxOn2 = true;
        } else {
            hCNetSDK.NET_DVR_PTZControl(m_lRealHandle, HCNetSDK.AUX_PWRON1, 1);
            jButtonAux2.setText("辅助2");
            m_bAuxOn2 = false;
        }
    }//GEN-LAST:event_jButtonAux2ActionPerformed

    /*************************************************
     函数:       轨道记录  "开始"按钮  双击响应函数
     函数描述:	开始轨道记录
     *************************************************/
    private void jButtonTrackStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTrackStartActionPerformed
        if (!hCNetSDK.NET_DVR_PTZTrack(m_lRealHandle, HCNetSDK.STA_MEM_CRUISE)) {
            JOptionPane.showMessageDialog(this, "开始记录轨迹失败");
            return;
        }
    }//GEN-LAST:event_jButtonTrackStartActionPerformed

    /*************************************************
     函数:       轨道记录  "停止"按钮  双击响应函数
     函数描述:	停止轨道记录
     *************************************************/
    private void jButtonTrackStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTrackStopActionPerformed
        if (!hCNetSDK.NET_DVR_PTZTrack(m_lRealHandle, HCNetSDK.STO_MEM_CRUISE)) {
            JOptionPane.showMessageDialog(this, "停止记录轨道失败");
            return;
        }
    }//GEN-LAST:event_jButtonTrackStopActionPerformed

    /*************************************************
     函数:       轨道记录  "运行"按钮  双击响应函数
     函数描述:	运行轨道记录
     *************************************************/
    private void jButtonTrackRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTrackRunActionPerformed
        if (!hCNetSDK.NET_DVR_PTZTrack(m_lRealHandle, HCNetSDK.RUN_CRUISE)) {
            JOptionPane.showMessageDialog(this, "运行轨迹失败");
            return;
        }
    }//GEN-LAST:event_jButtonTrackRunActionPerformed

    /*************************************************
     函数:       预置点  "调用"按钮  双击响应函数
     函数描述:	调用预置点
     *************************************************/
    private void jButtonGotoPresetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGotoPresetActionPerformed
        int iPreset = jComboBoxPreset.getSelectedIndex() + 1;
        if (!hCNetSDK.NET_DVR_PTZPreset(m_lRealHandle, HCNetSDK.GOTO_PRESET, iPreset)) {
            JOptionPane.showMessageDialog(this, "调用预置点失败");
            return;
        }
    }//GEN-LAST:event_jButtonGotoPresetActionPerformed

    /*************************************************
     函数:       预置点  "设置"按钮  双击响应函数
     函数描述:	设置预置点
     *************************************************/
    private void jButtonSetPresetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSetPresetActionPerformed
        int iPreset = jComboBoxPreset.getSelectedIndex() + 1;
        if (!hCNetSDK.NET_DVR_PTZPreset(m_lRealHandle, HCNetSDK.SET_PRESET, iPreset)) {
            JOptionPane.showMessageDialog(this, "设置预置点失败");
            return;
        }
    }//GEN-LAST:event_jButtonSetPresetActionPerformed

    /*************************************************
     函数:       预置点  "删除"按钮  双击响应函数
     函数描述:	删除预置点
     *************************************************/
    private void jButtonDeletePresetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeletePresetActionPerformed
        int iPreset = jComboBoxPreset.getSelectedIndex() + 1;
        if (!hCNetSDK.NET_DVR_PTZPreset(m_lRealHandle, HCNetSDK.CLE_PRESET, iPreset)) {
            JOptionPane.showMessageDialog(this, "设置预置点失败");
            return;
        }
    }//GEN-LAST:event_jButtonDeletePresetActionPerformed

    /*************************************************
     函数:       巡航路径  "调用"按钮  双击响应函数
     函数描述:	调用巡航路径
     *************************************************/
    private void jButtonGotoSeqActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGotoSeqActionPerformed
        byte iSeq = (byte) (jComboBoxSeq.getSelectedIndex() + 1);
        if (!m_bIsOnCruise) {
            if (!hCNetSDK.NET_DVR_PTZCruise(m_lRealHandle, HCNetSDK.RUN_SEQ, iSeq, (byte) 0, (short) 0)) {
                JOptionPane.showMessageDialog(this, "调用巡航失败");
                return;
            }
        }
    }//GEN-LAST:event_jButtonGotoSeqActionPerformed

    /*************************************************
     函数:       巡航路径  "设置"按钮  双击响应函数
     函数描述:	设置巡航路径
     *************************************************/
    private void jButtonSetSeqActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSetSeqActionPerformed
        JDialogPTZCruise dlgPTZCruise = new JDialogPTZCruise(this, true, m_lRealHandle);
        dlgPTZCruise.setBounds(this.getX(), this.getY(), 350, 270);
        dlgPTZCruise.setVisible(true);
    }//GEN-LAST:event_jButtonSetSeqActionPerformed

    private void jSliderBrightStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_jSliderBrightStateChanged
    {//GEN-HEADEREND:event_jSliderBrightStateChanged
        m_iBrightness = jSliderBright.getValue();
        setVideoEffect();
    }//GEN-LAST:event_jSliderBrightStateChanged

    private void jSliderContrastStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_jSliderContrastStateChanged
    {//GEN-HEADEREND:event_jSliderContrastStateChanged
        m_iContrast = jSliderContrast.getValue();
        setVideoEffect();
    }//GEN-LAST:event_jSliderContrastStateChanged

    private void jSliderSaturationStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_jSliderSaturationStateChanged
    {//GEN-HEADEREND:event_jSliderSaturationStateChanged
        m_iSaturation = jSliderSaturation.getValue();
        setVideoEffect();
    }//GEN-LAST:event_jSliderSaturationStateChanged

    private void jSliderHueStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_jSliderHueStateChanged
    {//GEN-HEADEREND:event_jSliderHueStateChanged
        m_iHue = jSliderHue.getValue();
        setVideoEffect();
    }//GEN-LAST:event_jSliderHueStateChanged

    private void jSliderVolumeStateChanged(javax.swing.event.ChangeEvent evt)//GEN-FIRST:event_jSliderVolumeStateChanged
    {//GEN-HEADEREND:event_jSliderVolumeStateChanged
        m_iVolume = jSliderVolume.getValue();

        if (ClientDemo.g_lVoiceHandle.intValue() >= 0) {
            hCNetSDK.NET_DVR_SetVoiceComClientVolume(ClientDemo.g_lVoiceHandle, (short) (m_iVolume * ((0xffff) / 100)));
        }
    }//GEN-LAST:event_jSliderVolumeStateChanged

    private void jButtonDefaultActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButtonDefaultActionPerformed
    {//GEN-HEADEREND:event_jButtonDefaultActionPerformed
        m_iBrightness = 6;
        m_iContrast = 6;
        m_iSaturation = 6;
        m_iHue = 6;
        m_iVolume = 50;

        jSliderBright.setValue(6);
        jSliderContrast.setValue(6);
        jSliderSaturation.setValue(6);
        jSliderHue.setValue(6);
        jSliderVolume.setValue(50);

        setVideoEffect();
    }//GEN-LAST:event_jButtonDefaultActionPerformed

    private boolean setVideoEffect() {
        if (!hCNetSDK.NET_DVR_ClientSetVideoEffect(m_lRealHandle, m_iBrightness, m_iContrast, m_iSaturation, m_iHue)) {
            JOptionPane.showMessageDialog(this, "设置预览视频显示参数失败");
            return false;
        } else {
            return true;
        }
    }

    /*************************************************
     函数名:    PTZControlAll
     函数描述:	云台控制函数
     输入参数:
     lRealHandle: 预览句柄
     iPTZCommand: PTZ控制命令
     iStop: 开始或是停止操作
     输出参数:
     返回值:
     *************************************************/
    private void PTZControlAll(NativeLong lRealHandle, int iPTZCommand, int iStop) {
        int iSpeed = jComboBoxSpeed.getSelectedIndex();
        if (lRealHandle.intValue() >= 0) {
            boolean ret;
            if (iSpeed >= 1)//有速度的ptz
            {
                ret = hCNetSDK.NET_DVR_PTZControlWithSpeed(lRealHandle, iPTZCommand, iStop, iSpeed);
                if (!ret) {
                    JOptionPane.showMessageDialog(this, "云台控制失败,错误码：" + hCNetSDK.NET_DVR_GetLastError());
                    return;
                }
            } else//速度为默认时
            {
                ret = hCNetSDK.NET_DVR_PTZControl(lRealHandle, iPTZCommand, iStop);
                if (!ret) {
                    JOptionPane.showMessageDialog(this, "云台控制失败,错误码： " + hCNetSDK.NET_DVR_GetLastError());
                    return;
                }
            }
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1FocusNear;
    private javax.swing.JButton jButton1IrisClose;
    private javax.swing.JButton jButton1IrisOpen;
    private javax.swing.JButton jButton1ZoomOut;
    private javax.swing.JButton jButtonAuto;
    private javax.swing.JButton jButtonAux1;
    private javax.swing.JButton jButtonAux2;
    private javax.swing.JButton jButtonDefault;
    private javax.swing.JButton jButtonDeletePreset;
    private javax.swing.JButton jButtonFanPwron;
    private javax.swing.JButton jButtonFocusFar;
    private javax.swing.JButton jButtonGotoPreset;
    private javax.swing.JButton jButtonGotoSeq;
    private javax.swing.JButton jButtonHeater;
    private javax.swing.JButton jButtonLeft;
    private javax.swing.JButton jButtonLeftDown;
    private javax.swing.JButton jButtonLeftUp;
    private javax.swing.JButton jButtonLight;
    private javax.swing.JButton jButtonRight;
    private javax.swing.JButton jButtonRightDown;
    private javax.swing.JButton jButtonRightUp;
    private javax.swing.JButton jButtonSetPreset;
    private javax.swing.JButton jButtonSetSeq;
    private javax.swing.JButton jButtonTrackRun;
    private javax.swing.JButton jButtonTrackStart;
    private javax.swing.JButton jButtonTrackStop;
    private javax.swing.JButton jButtonUp;
    private javax.swing.JButton jButtonWiperPwron;
    private javax.swing.JButton jButtonZoomIn;
    private javax.swing.JButton jButtondown;
    private javax.swing.JButton jButtonMoveLeft;
    private javax.swing.JButton jButtonMoveRight;
    private javax.swing.JComboBox jComboBoxPreset;
    private javax.swing.JComboBox jComboBoxSeq;
    private javax.swing.JComboBox jComboBoxSpeed;
    private javax.swing.JComboBox jComboBoxAutoControl;   //自动控制下拉筐
    private javax.swing.JComboBox jComboBoxOCRAPI;  //选择ocr接口下拉框
    private javax.swing.JComboBox jComboBoxValue;    //阈值下拉框
    private javax.swing.JComboBox jComboBoxShowJfram;    //显示ocr结结果下拉筐
    public javax.swing.JComboBox jComboBoxDark;     //开启夜间模式下拉框
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanelPTZ;
    private javax.swing.JPanel jPanelVideoPara;
    private javax.swing.JSlider jSliderBright;
    private javax.swing.JSlider jSliderContrast;
    private javax.swing.JSlider jSliderHue;
    private javax.swing.JSlider jSliderSaturation;
    private javax.swing.JSlider jSliderVolume;
    // End of variables declaration//GEN-END:variables
}
